﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _12._3
{
    public class animals:List<Animal>
    {
        public animals() { }
        public animals(IEnumerable<Animal> animals)
        {
            foreach (Animal item in animals)
            {
                Add(item);
            }
        }

        public string Sum()
        {
            StringBuilder sb = new StringBuilder();
            Animal animal=new Animal("a");
            sb.Append(animal);
            foreach (Animal am in this)
            {
                sb.AppendFormat($"+{am}");
                
            }
            return sb.ToString();
        }
    }
}
